home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 12
/
012.d81
/
comal #4
< prev
next >
Wrap
Text File
|
2022-08-26
|
3KB
|
152 lines
COMAL corner-Part 4 by Jimmy Weiler
THE COMAL 0.14 OPERATING SYSTEM
- - - - - - - - - - - - - - - - - -
PART THE SECOND: GETTING SOPHISTICATED
WITH DISK STORAGE.
- - - - - - - - - - - - - - - - - -
Command: 'CHAIN'
In BASIC, you can't easily LOAD and
RUN a program in one step, especially
from within another program.
In COMAL, the CHAIN command does the
job.
To LOAD and RUN "MY PROGRAM", enter
CHAIN "MY PROGRAM".
To make one program run another, all
you have to do is place a CHAIN
command inside the first program:
100 PRINT "HELLO"
300 CHAIN "PART 2"
This will print "HELLO" on the
screen and then run a program called
"PART 2". If this program were saved
as "PART 2", it would continually
rerun itself.
- - - - - - - - - - - - - - - - - -
Command: 'LIST "name"'
LOAD and CHAIN work only with
programs that have been SAVEd, which
brings us to the other way to put a
program on disk -- LIST. Don't get
confused here... LIST all by itself,
or with a range of numbers will list
the program in memory to the screen.
LIST followed by a name in quotes
will create a SEQ file containing the
image of the program in memory.
Example:
LIST "MY PROGRAM.L"
If you give all your LISTed programs
the suffix ".L", you will be able to
recognize them at a glance.
- - - - - - - - - - - - - - - - - -
Command: 'ENTER'
To reload a program that has been
LISTed to disk, you use the ENTER
command:
ENTER "MY PROGRAM.L"
- - - - - - - - - - - - - - - - - -
'WHY USE LIST & ENTER'
If ENTER and LIST were nothing more
than another way to LOAD and SAVE they
wouldn't be much use. Well, it turns
out that there are significant
differences.
LOAD erases whatever was in memory
before it reads a file from the disk.
ENTER doesn't. ENTER merges the disk
file with the program in memory. This
fact lets you build a library of
procedures to merge into your programs
as you need them.
The other advantage of ENTER is that
it allows you to transport COMAL
programs from COMAL 0.14, the disk
version, to COMAL 2.0, the vastly
superior cartridge version.
- - - - - - - - - - - - - - - - - -
Command: 'DELETE'
Eventually, your disks fill up and
it's time to remove some files. In
BASIC, we use the SCRATCH command. In
COMAL, it's DELETE. If we want to
delete that little program we've been
working with, we just type
DELETE"0:YOUR PROGRAM".
Do NOT omit the "0". COMAL 0.14
needs it -- it refers to drive zero...
- - - - - - - - - - - - - - - - - -